﻿using Assets.Scripts.Interface;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using System;

public class ANProp : AProp {

    [SerializeField, Tooltip("获取MoveControl脚本")]
    private MoveControl mControl;
    [SerializeField, Tooltip("加速后的马力")]
    private float powerx=300;
    private bool isUsing=false;
    public override void Click()
    {
        if(!isUsing)
        {
            float inipow = mControl.power;//记录初始值

            isUsing = true;
            mControl.power += powerx;

            DOTween.To(() => mControl.power, x => mControl.power = x, inipow, 3).
                OnComplete(()=> { isUsing = false;

                });
            ReduceCount(1);
        }
    }

    public override void FixedAwake()
    {
        
        info = "二氧化氮加速器";
    }
  

    protected override void OnTriggerEnter(Collider other)
    {
        base.OnTriggerEnter(other);
     
            mControl = other.GetComponent<MoveControl>();
       
    }//触发主角碰撞事件
}
